<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		input{

		}
		.dj{
			background-color: yellow;
		}
		div{
			width: 200px;
			height: 200px;
			background-color: red;
			font-size: 50px;
			color: white;
			position: absolute;
		}
		.qh{
			z-index: 1;
		}
	</style>
</head>
<body>
	<input class="dj" type="button" value="按钮1">
	<input type="button" value="按钮2">
	<input type="button" value="按钮3">
	<div class="qh">A</div>
	<div>B</div>
	<div>C</div>
</body>
<script type="text/javascript">
	var inputs=document.getElementsByTagName("input");
	var divs=document.getElementsByTagName("div");
	for (var i = 0; i < inputs.length; i++) {
		inputs[i].index=i;
		inputs[i].onclick=function(){
			for (var i = 0; i < divs.length; i++) {
				inputs[i].className="";
				divs[i].className="";
			}
			inputs[this.index].className="dj";
			divs[this.index].className="qh";
		}
	}
</script>
</html>